#!/usr/bin/env python
# -*- coding:utf-8 -*-
from django import forms
import json
from app01 import models
class CreateUserForm(forms.Form):
    username = forms.CharField()
    user_group_id = forms.IntegerField(
        widget=forms.Select()
    )
    def __init__(self,*args,**kwargs):
        super(CreateUserForm,self).__init__(*args,**kwargs)
        self.fields['user_group_id'].widget.choices = models.UserGroup.objects.all().values_list('id','caption')